//
//  SLButton.m
//  StarLight
//
//  Created by Duke.wu on 16/6/15.
//  Copyright © 2016年 Duke.Wu. All rights reserved.
//

#import "SLButton.h"


@interface SLButton ()



@end

@implementation SLButton

- (instancetype)init{
  if (self = [super init]) {
    self.lefttitleLB = [UILabel labelWithFontSize:16 textColor:[UIColor blackColor]];
    [self addSubview:self.lefttitleLB];
    
    self.rightImage = [[UIImageView alloc] init];
    [self addSubview:self.rightImage];
    
    [self addConstraints];
  }
  return self;
}

- (void)addConstraints{
  [self.lefttitleLB mas_makeConstraints:^(MASConstraintMaker *make) {
    make.left.equalTo(self).offset(5);
    make.centerY.equalTo(self);
  }];
  
  [self.rightImage mas_makeConstraints:^(MASConstraintMaker *make) {
    make.centerY.equalTo(self);
    make.right.equalTo(self).offset(-5);
    make.size.mas_equalTo(CGSizeMake(15, 15));
  }];
}





/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
